/**
 * @author casazaft
 */
Package("xclab.mvc.patterns.command").Class("MacroCommand", {
        MacroCommand: function(){
 this.Super.constructor();            this.subCommands = [];
            this.initializeMacroCommand();
        },
        Methods: {
            addSubCommand: function(commandClassRef){
                this.subCommands.push(commandClassRef);
                
            },
            execute: function(notification){
                while (this.subCommands.length > 0) {
                    var commandClassRef = this.subCommands.shift();
                    var commandInstance = new commandClassRef();
                    commandInstance.execute(notification);
                }
            }
            
        },
        Extends: xclab.mvc.patterns.observer.Notifier
    })
